\documentclass[tikz,border=10pt]{standalone}
\usepackage{tikz}
\usepackage{tikz-feynman}
\usetikzlibrary{positioning}
\usetikzlibrary{graphs}
\begin{document}


\feynmandiagram [layered layout, horizontal=a to b] {
a -- [red, fermion, edge label'=\(ab\), momentum={[arrow style=red]\(p_{ab}\)}] b
-- [blue, photon, edge label'={\color{black}\(bc\)}] c
-- [green!40!black, scalar, momentum=\(p_{cd}\)] d,
};

\end{document}
